package com.guigu.www.luolujin.Conteoller;

import com.guigu.www.luolujin.Service.LljDiseaseService;
import com.guigu.www.pojo.Disease;
import com.guigu.www.pojo.PageVo;
import com.guigu.www.pojo.TemplateWholesomeDetails;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 作者 罗露金
 */
@RestController
@RequestMapping("/LljDiseaseServlet")
public class LljDiseaseServlet {
    @Autowired
    LljDiseaseService service;
    @GetMapping()
    public PageVo<Disease> pageDisease(Integer pageNum, Integer pageSize, String disName){
        return service.pageDisease(pageNum, pageSize, disName);
    }
    @PostMapping
    public void insertDisease(@RequestBody Disease disease){
        service.insertDisease(disease);
    }
    @DeleteMapping("{id}")
    public void deleteDisease(@PathVariable("id") Integer disId){
        service.deleteDisease(disId);
    }

    @PutMapping
    public void updateDisease(@RequestBody Disease disease){
        service.updateDisease(disease);
    }
    @GetMapping("{id}")
    public Disease selectById(@PathVariable("id") Integer disId) {
        return service.selectById(disId);
    }
}
